package cn.slipi.admin.common.contants.enumtype;

import java.util.Arrays;

/**
 * TODO: 请添加描述
 *
 * @author lee
 * @date 2019/4/26
 * @since 1.0.0
 */
public enum CouponTypeEnum {
    /**
     * 0：满减，1：折扣
     */
    FULL_REDUCTION(0, "满减"),

    DISCOUNT(1, "折扣");

    private Integer value;
    private String desc;

    CouponTypeEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static CouponTypeEnum getByValue(int value) {
        return Arrays.stream(CouponTypeEnum.values()).filter((t) -> t.getValue() == value).findFirst().get();
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
